#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "StateMachine.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class ProtocolConformance;

/// <summary>
/// ProtocolStateMachine
/// A ProtocolStateMachine is always defined in the context of a Classifier. It
/// specifies which BehavioralFeatures of the Classifier can be called in which
/// State and under which conditions, thus specifying the allowed invocation
/// sequences on the Classifier's BehavioralFeatures. A ProtocolStateMachine
/// specifies the possible and permitted Transitions on the instances of its context
/// Classifier, together with the BehavioralFeatures that carry the Transitions. In
/// this manner, an instance lifecycle can be specified for a Classifier, by
/// defining the order in which the BehavioralFeatures can be activated and the
/// States through which an instance progresses during its existence.
/// </summary>
class UMLMODEL_EXPORT ProtocolStateMachine : public StateMachine {

public: // Constructors and destructors
    explicit ProtocolStateMachine(const QString& umlType="uml::ProtocolStateMachine");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// conformances getter
    /// Conformance between ProtocolStateMachine 
    /// </summary>
    vector<shared_ptr<ProtocolConformance>>& conformances();

private: // Fields
    /// <summary>
    /// conformances
    /// Conformance between ProtocolStateMachine 
    /// </summary>
    vector<shared_ptr<ProtocolConformance>> conformances_;

};

} // namespace uml
